﻿using SH.Common.CommonReturn;
using SH.Room.Domain.RoomClass;
using SH.Room.ErrorCodeEnum;
using SH.Room.Infrastructure.IRepository;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SH.Room.Infrastructure.Repository
{
    public class RoomPriceRepository : BaseRepository<RoomPrice>, IRoomPriceRepository
    {
        private readonly ISqlSugarClient _context;
        public RoomPriceRepository(ISqlSugarClient context) : base(DbManger.BizDb)
        {
            _context = DbManger.BizDb;
        }

        /// <summary>
        /// 房价删除
        /// </summary>
        /// <param name="rpid">房价ID</param>
        /// <returns>受影响行数</returns>
        /// <exception cref="NotImplementedException"></exception>
        public ApiResult<int> DelRoomprice(int rpid)
        {
           ApiResult<int> apiResult = new ApiResult<int>();
            var item=_context.Deleteable<RoomPrice>().Where(x=>x.RpId==rpid).ExecuteCommand();
            apiResult.Success();
            return apiResult;
        }
    }
}
